File manager - Edit - /home/autoph/public_html/projects/Rating-AutoHub/public/css/political_club.php.tar
Back
home/autoph/public_html/connectv1/api/political_club/political_club.php 0000644 00000001464 15030215236 0022434 0 ustar 00 <?php include_once("../../cfg/db.php"); include_once("../controllers/political_club.php"); include_once("../controllers/utility.php"); $political_club = new PoliticalClub(); $utility = new Utility(); $server_method = $_SERVER["REQUEST_METHOD"]; if(isset($_REQUEST['apiKey']) ){ $apiKey = $_REQUEST['apiKey']; if($apiKey === '0830651803564624' ){ //Get Interest Content $search = isset($_REQUEST['search']) ? $db -> escape($_REQUEST['search']) : '' ; $political_club->read_political_club_content($search,$db); }else{ $return_arr["message"]=" You are not allowed to do this action."; echo $return_arr["message"]; return; } }else{ $return_arr["message"]=" You are not allowed to do this action."; echo $return_arr["message"]; return; } ?> home/autoph/public_html/connectv1/api/controllers/political_club.php 0000644 00000001612 15030266047 0022016 0 ustar 00 <?php class PoliticalClub{ function read_political_club_content($search,$db){ $political_clubs = $db -> return_result("SELECT id,name FROM `source_political_clubs` WHERE status=1 AND `name` LIKE '%$search%' ORDER BY name ASC LIMIT 10"); $json = []; foreach($political_clubs as $political_club){ $json[] = ['id'=>$political_club['name'], 'text'=>$political_club['name']]; } echo json_encode($json); } function read_political_club_id_by_name($name,$db){ return $db -> select("SELECT id FROM `source_political_clubs` WHERE status=1 AND `name` = '$name' "); } function create_political_club($name,$db){ return $db -> sql_query_id("INSERT INTO source_political_clubs (name,date_added,status) VALUES ('$name',NOW(),'1')"); } } ?>